import * as _ from 'lodash'
/**
 * 仿造php的array_columns函数
 * @param arr
 * @param column
 * @returns {Array}
 */
export function array_columns(arr:any|Array<any>,column:string,unique=false){
    let a:any[]=[];
    _.forOwn(arr,(v:any,k)=>{
        if(unique){
            if(a.indexOf(v[column])==-1){
                a.push(v[column])
            }
        }else{
            a.push(v[column])
        }
    })
    return a;
}